package com.eliza.library.dao

import androidx.lifecycle.LiveData
import androidx.room.*
import com.eliza.library.model.Contactor


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 5/1/22
 * @Software: Android Condio
 */

@Dao
interface ContactorDao {
    @Insert
    suspend fun insertCon(vararg stu: Contactor)

    @Delete
    suspend fun deleteCon(vararg stu: Contactor)

    @Update
    suspend fun updateCon(vararg stu: Contactor)

    @Query("SELECT * FROM Contactor")
    fun getAllConList(): LiveData<List<Contactor>>//使用liveData 更新数据

    @Query("SELECT * FROM Contactor Where Id = :id ")
    suspend fun getConById(id: Int): List<Contactor>

}